﻿<!-- #include file="../Include/Admin_Onlogin.asp" -->
<!-- #Include File="../../Include/Md5.asp" -->
<%
Data_Name = "{prefix}Admin"
strFileName = "Admin_Admin.asp"
Dim sqlAuth, rsAuth, PurviewID
sqlAuth = "Select AuthID From Admin_Auth Where href='Admin/" & strFileName & "' Order By sort Asc,AuthID Asc"
Call Exec(rsAuth,sqlAuth,2)
If rsAuth.BOF And rsAuth.EOF Then
	PurviewID = 0
Else
	PurviewID = rsAuth(0)
	CheckPurview PurviewID,0
End If
rsAuth.Close
Set rsAuth = Nothing
Select Case Action
Case "Add"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Add' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call AddAdmin()
Case "SaveAdd"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Insert' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call SaveAdd()
Case "Modify"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Edit' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call Modify()
Case "SaveModify"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Update' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call SaveModify()
Case "AdminEnable"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Enable' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call AdminEnable()
Case "AdminState"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/State' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call AdminState()
Case "Del"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='Admin/Del' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
    Call DelAdmin()
Case Else
    Call Main()
End Select
If FoundErr = True Then
	Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Call CloseConn()

Sub Main()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Sql = "Select * From ["&Data_Name&"] Order By ID Desc"
		Call Exe_Conn(Rs,Sql,1)
		i = 0
		If Rs.BOF And Rs.EOF Then
			data = ""
		Else
			If Request("Page") <> "" Then
				CurrentPage = Code_CLng(Request("Page"))
			Else
				CurrentPage = 1
			End If
			MaxPerPage = Code_CLng(Trim(Request("limit")))
			If MaxPerPage <= 0 Then MaxPerPage = 10
			totalPut = Rs.RecordCount
			If CurrentPage < 1 Then
				CurrentPage = 1
			End If
			If (CurrentPage - 1) * MaxPerPage > totalPut Then
				If (totalPut Mod MaxPerPage) = 0 Then
					CurrentPage = totalPut \ MaxPerPage
				Else
					CurrentPage = totalPut \ MaxPerPage + 1
				End If
			End If
			If CurrentPage > 1 Then
				If (CurrentPage - 1) * MaxPerPage < totalPut Then
					Rs.Move (CurrentPage - 1) * MaxPerPage
				Else
					CurrentPage = 1
				End If
			End If
			Do While Not Rs.Eof
				If Rs("LastLoginTime") <> "" Then LastLoginTime = Time_Type(Rs("LastLoginTime"),1)
				If Rs("LastLogoutTime") <> "" Then LastLogoutTime = Time_Type(Rs("LastLogoutTime"),1)
				If Rs("GroupID") = "0" Then
					GroupID = ToUnicode("超级管理员")
				Else
					sqlGroup="select * from Admin_Group where GroupID="&Rs("GroupID")&" And status=1"
					Call Exec(rsGroup,sqlGroup,2)
					If rsGroup.BOF And rsGroup.EOF Then
						rsGroup.Close
					Else
						GroupID = ToUnicode(rsGroup("GroupName"))
						rsGroup.Close
						set rsGroup=Nothing
					End If
				End If
				If i=0 Then
					data = data & "{""id"":"&Rs("id")&",""username"":"""&Rs("UserName")&""",""GroupID"":"""&GroupID&""",""EnableMultiLogin"":"""&Rs("EnableMultiLogin")&""",""LastLoginIP"":"""&Rs("LastLoginIP")&""",""LastLoginTime"":"""&LastLoginTime&""",""LastLogoutTime"":"""&LastLogoutTime&""",""LoginTimes"":"""&Rs("LoginTimes")&""",""is_open"":"""&Rs("IsOpen")&"""}"
				Else
					data = data & ",{""id"":"&Rs("id")&",""username"":"""&Rs("UserName")&""",""GroupID"":"""&GroupID&""",""EnableMultiLogin"":"""&Rs("EnableMultiLogin")&""",""LastLoginIP"":"""&Rs("LastLoginIP")&""",""LastLoginTime"":"""&LastLoginTime&""",""LastLogoutTime"":"""&LastLogoutTime&""",""LoginTimes"":"""&Rs("LoginTimes")&""",""is_open"":"""&Rs("IsOpen")&"""}"
				End If
				iCount = iCount + 1
				If iCount >= MaxPerPage Then Exit Do
				Rs.MoveNext
				i=i+1
			Loop
			Rs.Close
		End If
		If totalPut = 0 Then
			Response.Write "{""code"":201,""msg"":""\u65e0\u6570\u636e""}" & vbCrLf
		Else
			Response.Write "{""code"":0,""msg"":""\u83b7\u53d6\u6210\u529f!"",""count"":"&totalPut&",""data"":["&data&"],""rel"":1}" & vbCrLf
		End If
		Response.End()
	Else
		Response.Write "<!DOCTYPE html>" & vbCrLf
		Response.Write "<head>" & vbCrLf
		Response.Write "<title>管理员管理</title>" & vbCrlf
		Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
		Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
		Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
		Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
		Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
		Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
		Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
		Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
		Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
		Response.Write "<script type='text/javascript'>" & vbCrLf
		Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
		Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
		Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
		Response.Write "</head>" & vbCrlf
		Response.Write "<body>" & vbCrlf
		Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrlf
		Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
		Response.Write "        <legend>管理员列表</legend>" & vbCrlf
		Response.Write "    </fieldset>" & vbCrlf
		Response.Write "    <table class=""layui-table"" id=""list"" lay-filter=""list""></table>" & vbCrlf
		Response.Write "</div>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""barDemo"">" & vbCrlf
		If Code_CLng(AdminGroupID) <> 0 Then
			Response.Write "    {{# if(d.id==1 || d.GroupID=='超级管理员'){ }}" & vbCrlf
			Response.Write "    <a class=""layui-btn layui-btn-xs layui-btn-disabled"">编辑</a>" & vbCrlf
			Response.Write "    {{# }else{  }}" & vbCrlf
			Response.Write "    <a href=""?Action=Modify&ID={{d.id}}"" class=""layui-btn layui-btn-xs"">编辑</a>" & vbCrlf
			Response.Write "    {{# } }}" & vbCrlf
		Else
			Response.Write "    <a href=""?Action=Modify&ID={{d.id}}"" class=""layui-btn layui-btn-xs"">编辑</a>" & vbCrlf
		End If
		Response.Write "    {{# if(d.id==1 || d.username=='"&Login_Username&"'){ }}" & vbCrlf
		Response.Write "    <a class=""layui-btn layui-btn-xs layui-btn-disabled"">删除</a>" & vbCrlf
		Response.Write "    {{# }else{  }}" & vbCrlf
		Response.Write "    <a class=""layui-btn layui-btn-danger layui-btn-xs"" lay-event=""del"">删除</a>" & vbCrlf
		Response.Write "    {{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""username"">" & vbCrlf
		Response.Write "    {{# if(d.username=='"&Login_Username&"'){ }}" & vbCrlf
		Response.Write "    <font color='red'>{{d.username}}</font>" & vbCrlf
		Response.Write "    {{# }else{  }}" & vbCrlf
		Response.Write "    {{d.username}}" & vbCrlf
		Response.Write "    {{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""GroupID"">" & vbCrlf
		Response.Write "    {{# if(d.GroupID=='超级管理员'){ }}" & vbCrlf
		Response.Write "    <font color=blue>超级管理员</font>" & vbCrlf
		Response.Write "    {{# }else{  }}" & vbCrlf
		Response.Write "    {{d.GroupID}}" & vbCrlf
		Response.Write "    {{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""EnableMultiLogin"">" & vbCrlf
		Response.Write "    <input type=""checkbox"" name=""EnableMultiLogin"" value=""{{d.id}}"" lay-skin=""switch"" lay-text=""允许|不允许"" lay-filter=""Enable"" {{ d.EnableMultiLogin == 'True' ? 'checked' : '' }}>" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""open"">" & vbCrlf
		Response.Write "    {{# if(d.id==1 || d.username=='"&Login_Username&"'){ }}" & vbCrlf
		Response.Write "    <input type=""checkbox"" disabled name=""is_open"" value=""{{d.id}}"" lay-skin=""switch"" lay-text=""开启|关闭"" lay-filter=""open"" checked>" & vbCrlf
		Response.Write "    {{# }else{  }}" & vbCrlf
		Response.Write "    <input type=""checkbox"" name=""is_open"" value=""{{d.id}}"" lay-skin=""switch"" lay-text=""开启|关闭"" lay-filter=""open"" {{ d.is_open == 'True' ? 'checked' : '' }}>" & vbCrlf
		Response.Write "    {{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""topBtn"">" & vbCrlf
		Response.Write "   <a href=""?Action=Add"" class=""layui-btn layui-btn-sm"">添加管理员</a>" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script>" & vbCrlf
		Response.Write "    layui.use(['table','form'], function() {" & vbCrlf
		Response.Write "        var table = layui.table,form = layui.form,$ = layui.jquery;" & vbCrlf
		Response.Write "        var tableIn = table.render({" & vbCrlf
		Response.Write "            elem: '#list'," & vbCrlf
		Response.Write "            url: '?Action=Main'," & vbCrlf
		Response.Write "            method:'post'," & vbCrlf
		Response.Write "            toolbar: '#topBtn'," & vbCrlf
		Response.Write "            title:'管理员列表'," & vbCrlf
		Response.Write "            cellMinWidth: 80," & vbCrLf
		Response.Write "            page:true," & vbCrLf
		Response.Write "            cols: [[" & vbCrlf
		Response.Write "                {field:'id', title: '编号', width:60,fixed: true}" & vbCrlf
		Response.Write "                ,{field:'username', title: '用户名', width:180,templet: '#username'}" & vbCrlf
		Response.Write "                ,{field:'GroupID', title: '角色', width:180,templet: '#GroupID'}" & vbCrlf
		Response.Write "                ,{field:'EnableMultiLogin', title: '多人登录', width:100,templet: '#EnableMultiLogin'}" & vbCrlf
		Response.Write "                ,{field:'LastLoginIP', title: 'IP地址', width:150}" & vbCrlf
		Response.Write "                ,{field:'LastLoginTime', title: '最后登录时间',width:160}" & vbCrlf
		Response.Write "                ,{field:'LastLogoutTime', title: '最后退出时间',width:160}" & vbCrlf
		Response.Write "                ,{field:'LoginTimes', title: '登录次数',width:150}" & vbCrlf
		Response.Write "                ,{field:'is_open', title: '状态',width:100,toolbar: '#open'}" & vbCrlf
		Response.Write "                ,{title: '操作', width:120, align:'center', toolbar: '#barDemo'}" & vbCrlf
		Response.Write "            ]]" & vbCrlf
		Response.Write "        });" & vbCrlf
		Response.Write "        form.on('switch(Enable)', function(obj){" & vbCrlf
		Response.Write "            loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
		Response.Write "            var id = this.value;" & vbCrlf
		Response.Write "            var EnableMultiLogin = obj.elem.checked===true?1:0;" & vbCrlf
		Response.Write "            $.ajax({" & vbCrLf
		Response.Write "                type: 'post'," & vbCrLf
		Response.Write "                url: '?Action=AdminEnable'," & vbCrLf
		Response.Write "                data: {'id':id,'EnableMultiLogin':EnableMultiLogin}," & vbCrLf
		Response.Write "                dataType: 'json'," & vbCrLf
		Response.Write "                success: function(res) {" & vbCrLf
		Response.Write "                    layer.close(loading);" & vbCrlf
		Response.Write "                    if (res.code==1) {" & vbCrlf
		Response.Write "                        tableIn.reload();" & vbCrlf
		Response.Write "                    }else{" & vbCrlf
		Response.Write "                        layer.msg(res.msg,{time:1000,icon:2});" & vbCrlf
		Response.Write "                        return false;" & vbCrlf
		Response.Write "                    }" & vbCrLf
		Response.Write "                }" & vbCrLf
		Response.Write "            });" & vbCrLf
		Response.Write "        });" & vbCrlf
		Response.Write "        form.on('switch(open)', function(obj){" & vbCrlf
		Response.Write "            loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
		Response.Write "            var id = this.value;" & vbCrlf
		Response.Write "            var is_open = obj.elem.checked===true?1:0;" & vbCrlf
		Response.Write "            $.ajax({" & vbCrLf
		Response.Write "                type: 'post'," & vbCrLf
		Response.Write "                url: '?Action=AdminState'," & vbCrLf
		Response.Write "                data: {'id':id,'is_open':is_open}," & vbCrLf
		Response.Write "                dataType: 'json'," & vbCrLf
		Response.Write "                success: function(res) {" & vbCrLf
		Response.Write "                    layer.close(loading);" & vbCrlf
		Response.Write "                    if (res.code==1) {" & vbCrlf
		Response.Write "                        tableIn.reload();" & vbCrlf
		Response.Write "                    }else{" & vbCrlf
		Response.Write "                        layer.msg(res.msg,{time:1000,icon:2});" & vbCrlf
		Response.Write "                        return false;" & vbCrlf
		Response.Write "                    }" & vbCrLf
		Response.Write "                }" & vbCrLf
		Response.Write "            });" & vbCrLf
		Response.Write "        });" & vbCrlf
		Response.Write "        table.on('tool(list)', function(obj){" & vbCrlf
		Response.Write "            var data = obj.data;" & vbCrlf
		Response.Write "            if(obj.event === 'del'){" & vbCrlf
		Response.Write "                layer.confirm('你确定要删除吗？', function(index){" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Del'," & vbCrLf
		Response.Write "                        data: {id:data.id,username:data.username}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            if (res.code == 1) {" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
		Response.Write "                                obj.del();" & vbCrLf
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "        });" & vbCrlf
		Response.Write "    });" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "</body>" & vbCrLf & "</html>"
	End If
End Sub

Sub AddAdmin()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>管理员管理</title>" & vbCrLf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	Response.Write "<form class='layui-form layui-form-pane' id=""myform"" name=""myform"" method='post' action='" & strFileName & "'>"
	Response.Write "<div class=""admin-main fadeInUp animated"">" & vbCrlf
	Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
	Response.Write "        <legend>添加管理员</legend>" & vbCrlf
	Response.Write "    </fieldset>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">管理员名：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input name=""username"" type=""text"" id=""username"" size=""30"" maxlength=""30"" value="""" lay-verify=""required"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">初始密码：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='password' id='Password' name='Password' onkeyup='javascript:EvalPwdStrength(document.forms[0],this.value);' onmouseout='javascript:EvalPwdStrength(document.forms[0],this.value);' onblur='javascript:EvalPwdStrength(document.forms[0],this.value);' value="""" lay-verify=""required"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">密码强度：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Call ShowPwdStrength()
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">确认密码：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='password' id='PwdConfirm' name='PwdConfirm' value="""" lay-verify=""PwdConfirm"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">多人登录：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input id='EnableMultiLogin' name='EnableMultiLogin' type='checkbox' value='Yes' title='允许多人同时登录'>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">所属角色：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            " & Class_Add_Edit_List(0,0,0) & "" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "</div>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<input type=""hidden"" name=""Action"" id='Action' value=""SaveAdd""><input name='Scode' type='hidden' id='Scode' value='" & CheckSecretCode("start") & "'>" & Submit_Layui("提交添加","重新填写","确认要清空对话框内容？","javascript:history.back();","返回上一页","") & vbCrlf
	Response.Write "</form>"
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['form'], function () {" & vbCrlf
	Response.Write "    var form = layui.form;" & vbCrlf
	Response.Write "    //自定义表单验证" & vbCrlf
	Response.Write "    form.verify({" & vbCrlf
	Response.Write "        PwdConfirm: function (value, item) {" & vbCrlf
	Response.Write "            if ($('input[name=Password]').val() !== value){" & vbCrlf
	Response.Write "                item.select();" & vbCrlf
	Response.Write "                return ""初始密码与确认密码不同！"";" & vbCrlf
 	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //提交监听" & vbCrlf
	Response.Write "    form.on('submit(submit)', function (data) {" & vbCrlf
	Response.Write "        loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
	Response.Write "        $.ajax({" & vbCrLf
	Response.Write "            type: 'post'," & vbCrLf
	Response.Write "            url: '?Action=SaveAdd'," & vbCrLf
	Response.Write "            data: data.field," & vbCrLf
	Response.Write "            dataType: 'json'," & vbCrLf
	Response.Write "            success: function(res) {" & vbCrLf
	Response.Write "                layer.close(loading);" & vbCrlf
	Response.Write "                if(res.code > 0){" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
	Response.Write "                        location.href = res.url;" & vbCrlf
	Response.Write "                    });" & vbCrlf
	Response.Write "                }else{" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 2, time: 1000});" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrLf
	Response.Write "        });" & vbCrLf
	Response.Write "    });" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub Modify()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>管理员管理</title>" & vbCrLf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	Dim UserID
	Dim rsAdmin, sqlAdmin
	UserID = Trim(Request("ID"))
	If UserID = "" Then
		Response.Write IsSuccess("请指定要修改的管理员ID！",AdminFolder & "/Admin/"&strFileName)
		Exit Sub
	Else
		UserID = Code_CLng(UserID)
	End If
	sqlAdmin = "Select * From ["&Data_Name&"] where ID=" & UserID
	Call Exe_Conn(rsAdmin,sqlAdmin,3)
	If rsAdmin.BOF And rsAdmin.EOF Then
		Response.Write IsSuccess("不存在此管理员！",AdminFolder & "/Admin/"&strFileName)
		rsAdmin.Close
		Set rsAdmin = Nothing
		Exit Sub

	End If
	Response.Write "<form class='layui-form layui-form-pane' id=""myform"" name=""myform"" method='post' action='" & strFileName & "'>"
	Response.Write "<div class=""admin-main fadeInUp animated"">" & vbCrlf
	Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
	Response.Write "        <legend>修改管理员</legend>" & vbCrlf
	Response.Write "    </fieldset>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">管理员名：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input name=""username"" type=""text"" id=""username"" size=""30"" maxlength=""30"" value=""" & rsAdmin("UserName") & """ lay-verify=""required"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">新 密 码：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='password' id='Password' name='Password' onmouseover=""layer.tips('初始密码：" & Decryptstr(rsAdmin("Password")) & "',this,{tips: [1, '#000']});"" onkeyup='javascript:EvalPwdStrength(document.forms[0],this.value);' onmouseout='layer.closeAll();javascript:EvalPwdStrength(document.forms[0],this.value);' onblur='javascript:EvalPwdStrength(document.forms[0],this.value);' value="""" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">密码强度：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Call ShowPwdStrength()
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">确认密码：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='password' id='PwdConfirm' name='PwdConfirm' value="""" onmouseover=""layer.tips('初始密码：" & Decryptstr(rsAdmin("Password")) & "',this,{tips: [1, '#000']});"" onmouseout=""layer.closeAll();"" lay-verify=""PwdConfirm"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">多人登录：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input id='EnableMultiLogin' name='EnableMultiLogin' type='checkbox' value='Yes' title='允许多人同时登录'"
    If rsAdmin("EnableMultiLogin") = True Then Response.Write " checked"
	Response.Write ">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">所属角色：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            " & Class_Add_Edit_List(UserID,0,rsAdmin("GroupID")) & "" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "</div>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<input name='ID' type='hidden' value='" & rsAdmin("ID") & "'><input type=""hidden"" name=""Action"" id='Action' value=""SaveModify""><input name='Scode' type='hidden' id='Scode' value='" & CheckSecretCode("start") & "'>" & Submit_Layui("提交修改","重新填写","确认要清空对话框内容？","javascript:history.back();","返回上一页","") & vbCrlf
	Response.Write "</form>"
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['form'], function () {" & vbCrlf
	Response.Write "    var form = layui.form;" & vbCrlf
	Response.Write "    //自定义表单验证" & vbCrlf
	Response.Write "    form.verify({" & vbCrlf
	Response.Write "        PwdConfirm: function (value, item) {" & vbCrlf
	Response.Write "            if ($('input[name=Password]').val() !== value){" & vbCrlf
	Response.Write "                item.select();" & vbCrlf
	Response.Write "                return ""新密码与确认密码不同！"";" & vbCrlf
 	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //提交监听" & vbCrlf
	Response.Write "    form.on('submit(submit)', function (data) {" & vbCrlf
	Response.Write "        loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
	Response.Write "        $.ajax({" & vbCrLf
	Response.Write "            type: 'post'," & vbCrLf
	Response.Write "            url: '?Action=SaveModify'," & vbCrLf
	Response.Write "            data: data.field," & vbCrLf
	Response.Write "            dataType: 'json'," & vbCrLf
	Response.Write "            success: function(res) {" & vbCrLf
	Response.Write "                layer.close(loading);" & vbCrlf
	Response.Write "                if(res.code > 0){" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
	Response.Write "                        location.href = res.url;" & vbCrlf
	Response.Write "                    });" & vbCrlf
	Response.Write "                }else{" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 2, time: 1000});" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrLf
	Response.Write "        });" & vbCrLf
	Response.Write "    });" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	rsAdmin.Close
	Set rsAdmin = Nothing
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub SaveAdd()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim UserName, Password, PwdConfirm, GroupID, EnableMultiLogin
		Dim rsAdmin, sqlAdmin

		'验证安全码
		If CheckSecretCode(Trim(Request.Form("Scode"))) <> True Then
			Response.Write "{""code"":0,""msg"":""\u975e\u6cd5\u63d0\u4ea4\u7684\u6570\u636e\uff01""}" & vbCrLf
			Response.End()
		End If

		UserName = Trim(Request.Form("UserName"))
		Password = Trim(Request.Form("Password"))
		PwdConfirm = Trim(Request.Form("PwdConfirm"))
		GroupID = Trim(Request.Form("GroupID"))
		EnableMultiLogin = Trim(Request.Form("EnableMultiLogin"))

		If UserName = "" Then
			Response.Write "{""code"":0,""msg"":""\u7ba1\u7406\u5458\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		Else
			If CheckBadChar(UserName) = False Then
				Response.Write "{""code"":0,""msg"":""\u7ba1\u7406\u5458\u540d\u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01""}" & vbCrLf
				Response.End()
			End If
		End If
		If Password = "" Then
			Response.Write "{""code"":0,""msg"":""\u521d\u59cb\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		End If
		If PwdConfirm <> Password Then
			Response.Write "{""code"":0,""msg"":""\u786e\u8ba4\u5bc6\u7801\u5fc5\u987b\u4e0e\u521d\u59cb\u5bc6\u7801\u76f8\u540c\uff01""}" & vbCrLf
			Response.End()
		End If
		If CheckBadChar(Password) = False Then
			Response.Write "{""code"":0,""msg"":""\u521d\u59cb\u5bc6\u7801\u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01""}" & vbCrLf
			Response.End()
		End If
		If GroupID = "" Then
			Response.Write "{""code"":0,""msg"":""\u6240\u5c5e\u89d2\u8272\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		Else
			GroupID = Code_CLng(GroupID)
		End If
		
		If FoundErr = True Then Exit Sub
		
		ID = GetNewID(Data_Name, "ID")
		sqlAdmin = "Select * From ["&Data_Name&"] where UserName='" & UserName & "'"
		Call Exe_Conn(rsAdmin,sqlAdmin,3)
		If Not (rsAdmin.BOF And rsAdmin.EOF) Then
			Response.Write "{""code"":0,""msg"":""\u6570\u636e\u5e93\u4e2d\u5df2\u7ecf\u5b58\u5728\u6b64\u7ba1\u7406\u5458\uff01""}" & vbCrLf
			Response.End()
			rsAdmin.Close
			Set rsAdmin = Nothing
			Exit Sub
		End If
		
		rsAdmin.addnew
		rsAdmin("ID") = ID
		rsAdmin("UserName") = UserName
		rsAdmin("Password") = Encryptstr(Password)
		rsAdmin("LoginTimes") = 0
		rsAdmin("GroupID") = GroupID
		If EnableMultiLogin = "Yes" Then
			rsAdmin("EnableMultiLogin") = True
		Else
			rsAdmin("EnableMultiLogin") = False
		End If
		rsAdmin("Purview") = 1
		'rsAdmin("IsOpen") = False
		rsAdmin.Update
		rsAdmin.Close
		Set rsAdmin = Nothing
		Response.Write "{""code"":1,""msg"":""\u6dfb\u52a0\u6210\u529f\uff01"",""url"":""?""}" & vbCrLf
		Response.End()
	End If
End Sub

Sub SaveModify()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim UserID, UserName, GroupID, EnableMultiLogin
		Dim rsAdmin, sqlAdmin

		'验证安全码
		If CheckSecretCode(Trim(Request.Form("Scode"))) <> True Then
			Response.Write "{""code"":0,""msg"":""\u975e\u6cd5\u63d0\u4ea4\u7684\u6570\u636e\uff01""}" & vbCrLf
			Response.End()
		End If
		
		UserID = Trim(Request.Form("ID"))
		UserName = Trim(Request.Form("UserName"))
		Password = Trim(Request.Form("Password"))
		PwdConfirm = Trim(Request.Form("PwdConfirm"))
		GroupID = Trim(Request.Form("GroupID"))
		EnableMultiLogin = Trim(Request.Form("EnableMultiLogin"))
		
		If UserID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u6307\u5b9a\u8981\u4fee\u6539\u7684\u7ba1\u7406\u5458ID\uff01""}" & vbCrLf
			Response.End()
		Else
			UserID = Code_CLng(UserID)
		End If
		If Password <> "" Then
			If PwdConfirm <> Password Then
				Response.Write "{""code"":0,""msg"":""\u786e\u8ba4\u5bc6\u7801\u5fc5\u987b\u4e0e\u65b0\u5bc6\u7801\u76f8\u540c\uff01""}" & vbCrLf
				Response.End()
			End If
			If CheckBadChar(Password) = False Then
				Response.Write "{""code"":0,""msg"":""\u65b0\u5bc6\u7801\u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\uff01""}" & vbCrLf
				Response.End()
			End If
		End If
		If GroupID = "" Then
			Response.Write "{""code"":0,""msg"":""\u6240\u5c5e\u89d2\u8272\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		Else
			GroupID = Code_CLng(GroupID)
		End If
		
		If FoundErr = True Then Exit Sub
		
		sqlAdmin = "Select * From ["&Data_Name&"] where ID=" & UserID
		Call Exe_Conn(rsAdmin,sqlAdmin,3)
		If rsAdmin.BOF And rsAdmin.EOF Then
			Response.Write "{""code"":0,""msg"":""\u4e0d\u5b58\u5728\u6b64\u7ba1\u7406\u5458\uff01""}" & vbCrLf
			Response.End()
			rsAdmin.Close
			Set rsAdmin = Nothing
			Exit Sub
		End If
		rsAdmin("UserName") = UserName
		rsAdmin("GroupID") = GroupID
		If Password <> "" Then
			rsAdmin("Password") = Encryptstr(Password)
		End If
		If EnableMultiLogin = "Yes" Then
			rsAdmin("EnableMultiLogin") = True
		Else
			rsAdmin("EnableMultiLogin") = False
		End If
		rsAdmin.Update
		rsAdmin.Close
		Set rsAdmin = Nothing
		Response.Write "{""code"":1,""msg"":""\u4fee\u6539\u6210\u529f\uff01"",""url"":""?""}" & vbCrLf
		Response.End()
	End If
End Sub

Sub AdminEnable()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		ID = Code_CLng(Trim(Code_Form("ID")))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u6307\u5b9a\u8981\u4fee\u6539\u7684\u7ba1\u7406\u5458ID\uff01""}" & vbCrLf
			Response.End()
		Else
			ID = Code_CLng(ID)
		End If
		EnableMultiLogin = Trim(Code_Form("EnableMultiLogin"))
		Call Exec("","Update ["&Data_Name&"] Set EnableMultiLogin="&EnableMultiLogin&" Where ID="&ID,0)
		Response.Write "{""msg"":""\u4fee\u6539\u6210\u529f"",""code"":1}"
		Response.End()
	End If
End Sub

Sub AdminState()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		ID = Code_CLng(Trim(Code_Form("ID")))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u6307\u5b9a\u8981\u4fee\u6539\u7684\u7ba1\u7406\u5458ID\uff01""}" & vbCrLf
			Response.End()
		Else
			ID = Code_CLng(ID)
		End If
		is_open = Trim(Code_Form("is_open"))
		Call Exec("","Update ["&Data_Name&"] Set IsOpen="&is_open&" Where ID="&ID,0)
		Response.Write "{""msg"":""\u4fee\u6539\u6210\u529f"",""code"":1}"
		Response.End()
	End If
End Sub

Sub DelAdmin()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim UserID, UserName, Cfs
		Dim rsAdmin, sqlAdmin

		'验证安全码
		'If CheckSecretCode(Trim(Request.Form("Scode"))) <> True Then
			'Response.Write "{""msg"":""\u975e\u6cd5\u63d0\u4ea4\u7684\u6570\u636e\uff01"",""code"":0}"
			'Response.End()
		'End If

		UserID = Trim(Request.Form("ID"))
		UserName = Trim(Request.Form("UserName"))
		If UserID = "" Then
			Response.Write "{""msg"":""\u8bf7\u6307\u5b9a\u8981\u5220\u9664\u7684\u7ba1\u7406\u5458ID\uff01"",""code"":0}"
			Response.End()
		End If
		Set Cfs=New Cls_FileSystem
		Cfs.Del_File "../Include/FilMk/"& UserName &"_Mk_a.xml"
		Cfs.Del_File "../Include/FilMk/"& UserName &"_Mk_b.xml"
		Set Cfs=Nothing
		If InStr(UserID, ",") > 0 Then
			Call Exec("","delete From ["&Data_Name&"] where ID in (" & UserID & ")",0)
		Else
			Call Exec("","delete From ["&Data_Name&"] where ID=" & UserID & "",0)
		End If
		Response.Write "{""msg"":""\u5220\u9664\u6210\u529f\uff01"",""code"":1}"
		Response.End()
	End If
End Sub

Sub ShowPwdStrength()
	Response.Write "<script type='text/javascript' src='PwdStrength.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "<!--" & vbCrLf
	Response.Write "window.onerror = ignoreError;" & vbCrLf
	Response.Write "function ignoreError(){return true;}" & vbCrLf
	Response.Write "function EvalPwdStrength(oF,sP){" & vbCrLf
	Response.Write "  PadPasswd(oF,sP.length*2);" & vbCrLf
	Response.Write "  if(ClientSideStrongPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(3,'cssStrong');}" & vbCrLf
	Response.Write "  else if(ClientSideMediumPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(2,'cssMedium');}" & vbCrLf
	Response.Write "  else if(ClientSideWeakPassword(sP,gSimilarityMap,gDictionary)){DispPwdStrength(1,'cssWeak');}" & vbCrLf
	Response.Write "  else{DispPwdStrength(0,'cssPWD');}" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "function PadPasswd(oF,lPwd){" & vbCrLf
	Response.Write "  if(typeof oF.PwdPad=='object'){var sPad='IfYouAreReadingThisYouHaveTooMuchFreeTime';var lPad=sPad.length-lPwd;oF.PwdPad.value=sPad.substr(0,(lPad<0)?0:lPad);}" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "function DispPwdStrength(iN,sHL){" & vbCrLf
	Response.Write "  if(iN>3){ iN=3;}for(var i=0;i<4;i++){ var sHCR='cssPWD';if(i<=iN){ sHCR=sHL;}if(i>0){ GEId('idSM'+i).className=sHCR;}GEId('idSMT'+i).style.display=((i==iN)?'inline':'none');}" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "function GEId(sID){return document.getElementById(sID);}" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<style>" & vbCrLf
	Response.Write ".cssPWD{background-color:#EBEBEB;border-right:solid 1px #BEBEBE;border-bottom:solid 1px #BEBEBE;}" & vbCrLf
	Response.Write ".cssWeak{background-color:#FF4545;border-right:solid 1px #BB2B2B;border-bottom:solid 1px #BB2B2B;}" & vbCrLf
	Response.Write ".cssMedium{background-color:#FFD35E;border-right:solid 1px #E9AE10;border-bottom:solid 1px #E9AE10;}" & vbCrLf
	Response.Write ".cssStrong{background-color:#3ABB1C;border-right:solid 1px #267A12;border-bottom:solid 1px #267A12;}" & vbCrLf
	Response.Write ".cssPWT{width:132px;}" & vbCrLf
	Response.Write "</style>" & vbCrLf
	Response.Write "<table cellpadding='0' cellspacing='0' class='cssPWT' style='height:38px;'><tr><td id='idSM1' width='33%' class='cssPWD' align='center'><span style='font-size:1px'>&nbsp;</span><span id='idSMT1' style='display:none;'>弱</span></td><td id='idSM2' width='34%' class='cssPWD' align='center' style='border-left:solid 1px #fff'><span style='font-size:1px'>&nbsp;</span><span id='idSMT0' style='display:inline;font-weight:normal;color:#666'>无</span><span id='idSMT2' style='display:none;'>中</span></td><td id='idSM3' width='33%' class='cssPWD' align='center' style='border-left:solid 1px #fff'><span style='font-size:1px'>&nbsp;</span><span id='idSMT3' style='display:none;'>强</span></td></tr></table>"
End Sub

Function Class_Add_Edit_List(uid,ofid,fid)
	Dim temp1,rsf,sqlf,disabled
	temp1="<div id=""GroupID_outer"" ztype=""select"" class=""z-combox"" style=""display:inline-block; *zoom: 1;*display: inline;vertical-align:middle;height:auto;width:auto;position:relative;border:none 0;margin:0;padding:0;white-space: nowrap;"" _style=""width:100%;""><input type=""text"" ztype=""select"" id=""GroupID"" name=""GroupID"" tabindex=""-1"" autocomplete=""off"" class=""inputText"" style=""width:100%;position:absolute;z-index:-1;"" value=""" & int(fid) & """ startvalue=""" & int(fid) & """"
	If uid = 1 Then
		temp1=temp1&"disabled"
	End If
	temp1=temp1&"/><input type=""text"" id=""GroupID_textField"" autocomplete=""off"" class=""inputText"" style=""vertical-align:middle; cursor:default;width:100%;"" /><a id=""GroupID_spinner"" class=""z-combox-spinner"" style=""position:relative; left:-17px; margin-right:-15px; cursor:pointer; width:13px; height:15px;vertical-align:middle;""><b></b></a><div id=""GroupID_list"" class=""optgroup"" style=""text-align:left;display:none;""><div id=""GroupID_ul"" style=""left:-1px; width:-1px;""><script>Combox_GroupID_Init=function(){var _el=Zving.getDom('GroupID');if(_el._components){return true;}var  _data=[];var  _DataSource;_data.push(['" & ofid & "','超级管理员']);"
	sqlf="select * from Admin_Group where status=1 order by GroupID Asc"
	Call Exec(rsf,sqlf,2)
	do while not rsf.eof
		temp1=temp1&"_data.push(['"&rsf("GroupID")&"','"&rsf("GroupName")&"']);"
		rsf.movenext
	loop
	rsf.close
	set rsf=nothing
	temp1=temp1&"var combox_GroupID = new Zving.Selector({el:_el,data:_data,DataSource:_DataSource});};if(Zving.Page.isReady){Combox_GroupID_Init();}else{Zving.Page.onReady(Combox_GroupID_Init);}</script></div></div></div>"
	Class_Add_Edit_List=temp1
End Function
%>